#!usr/bin/python
# _*_ coding: utf-8 *_*
'''
Created on 30 janv. 2011

@author: paraita
'''

from PIL import Image
import matplotlib.pylab as pylab




if __name__ == '__main__':
    im = Image.open('Lena.png')
    print im.format, im.size, im.mode
    out = im.point(lambda i : 255 if(i>128) else 0) # sert plus a rien :s
    #out.save('/home/paraita/Bureau/Lenabw.png')
    
    #h = im.histogram()
    
    
    pylab.hist(list(im.getdata()))
    pylab.show()
    
    
    
    
    